from neo4j import GraphDatabase

# neo4j数据库配置
# URL:str = "neo4j://localhost:7687"
# AUTH:dict = {
#             "username": "neo4j",
#             "password": "12345678"
#         }

# driver = GraphDatabase.driver(URL, auth=(AUTH["username"],AUTH["password"]))

uri = 'bolt://localhost:7687'
username = 'neo4j'
password = '12345678'

driver = GraphDatabase.driver(uri=uri, auth=(username,password))

# 使用with语句确保连接被正确关闭
with driver.session() as session:
    # 执行Cypher查询
    result = session.run("MATCH (n) RETURN n")
    for record in result:
        print(record["n"])





